package code;

import sun.applet.Main;

public class Main_String {
    public static void main(String[] args) {
        String word = "aeiou";
        int ans = 0, type = 1, len = 1;
        for(int i = 1; i < word.length(); i++){
            if(word.charAt(i) >= word.charAt(i-1)) len++; //更新当前字符串长度
            if(word.charAt(i) > word.charAt(i-1)) type++; //更新当前字符种类
            if(word.charAt(i) < word.charAt(i-1)) {type = 1; len = 1;} //当前字符串不美丽，从当前字符重新开始
            if(type == 5) ans = Math.max(ans, len);  //更新最大字符串
        }
        word.charAt(7);
        System.out.println(ans);

        char prev = 'x';
        int max = 0;
        int now = 0;
        char[] chs = word.toCharArray();
        for(int i = 0; i < word.length(); i++){
            switch(chs[i]){
                case 'a':
                    if(prev != 'a'){
                        now = 1;
                    }else{
                        now++;
                    }
                    break;
                case 'e':
                    if((prev != 'a' && prev != 'e') || now == 0){
                        now = 0;
                    }else{
                        now++;
                    }
                    break;
                case 'i':
                    if((prev != 'e' && prev != 'i') || now == 0){
                        now = 0;
                    }else{
                        now++;
                    }
                    break;
                case 'o':
                    if((prev != 'i' && prev != 'o') || now == 0){
                        now = 0;
                    }else{
                        now++;
                    }
                    break;
                case 'u':
                    if((prev != 'o' && prev != 'u') || now == 0){
                        now = 0;
                    }else{
                        now++;
                    }
                    max = Math.max(now,max);
                    break;
                default:
                    now = 0;
                    break;
            }
            prev = chs[i];
        }
        System.out.println(max);


    }
}
